function gets(pageNum) {
    var m = $("#dinumber").val();
    var l = $("#cname").val();
    var k = $("#jixing").val();
    var j = $("#guige").val();
    var i = $("#danwei").val();
    var h = $("#cc").val();
    var g = $("#qiye").val();
    var f = $("#shangpin").val();
    var e = $("#lefPprice").val();
    var d = $("#rightPrice").val();
    var c = $("#cengci").val();
    var b = $("#dcid").val();
    var a = $("#state").val();
    var pageN = pageNum;
    $.ajax({
            url: '/myspringboot/suppliser/findDIs',
            type: 'post',
            dataType: "json",
            data: {
                dinumber: m,
                cname: l,
                jixing: k,
                guige: j,
                danwei: i,
                cc: h,
                qiye: g,
                shangpin: f,
                lefPprice: e,
                rightPrice: d,
                cengci: c,
                leibie: b,
                state: a,
                pageNum: pageN,
            },
            success: function (result) {
                var result = result.data;
                yibu(result.pages, result.pageNum);
                var list = result.list;
                $(".a").empty();
                for (var i = 0; i < list.length; i++) {
                    var aa = 1 + i;
                    var sdiState = list[i].sdiState;//审核结果
                    var sp = list[i].supplier;
                    var surName = null ;
                    if (sp == null ) {
                        surName = null ;
                    }else{
                        surName = sp.surName;
                    }
                    var diId = list[i].diId;
                    var sDI = list[i].sdiDiInf;
                    var sdiId = null;
                    if(sDI == null){
                        sdiId = null;
                    }else{
                        sdiId = sDI.sdiId;
                    }
                    /*var sdiId = list[i].sdiDiInf.sdiId;*/
                    //药品流水号
                    var daNumber = list[i].diNumer;
                    //通用名
                    var diName = list[i].diName;
                    //剂型
                    var diForm = list[i].diForm;
                    //规格
                    var diSpecifications = list[i].diSpecifications;
                    //单位
                    var diUnit = list[i].diUnit;
                    //装换系数
                    var diCc = list[i].diCc;
                    //生产企业
                    var mfa = list[i].manufacturer;
                    var mfName = null;
                    if (mfa == null) {
                        mfName = null;
                    }else{
                        mfName=mfa.mfName;
                    }
                    //商品名称
                    var daName = list[i].drugAtegory.daName;
                    //中间jia
                    var diNewPrice = list[i].diNewPrice;
                    //质量层次
                    var drugQualityLevel = list[i].drugQualityLevel;
                    if (drugQualityLevel != null) {
                        var dqlName = drugQualityLevel.dqlName;
                    } else {
                        var dqlName = "null"
                    }
                    //药品类别
                    var drugCategory = list[i].drugCategory;
                    if (drugCategory != null) {
                        var dcName = drugCategory.dcName;
                    } else {
                        var dcName = "null"
                    }
                    //交易状态
                    var diTradingStatus = list[i].diTradingStatus;
                    var a = "";
                    if (diTradingStatus == 0) {
                        a = "未交易";
                    } else {
                        a = "交易完成"
                    }
                    var $tr = '<tr>' +
                        '<td>' + aa + '</td>' +
                        '<td><input class="selectItem1" name="choose" value=' + sdiId + ' type="checkbox"></td>' +
                        '<td>' +
                        '<select name="shenhe" id="shenhe">' +
                        '<option value="">请选择</option>' +
                        '<option value="'+2+'">审核通过</option>' +
                        '<option value="'+3+'">审核未通过</option>' +
                        '</select>' +
                        '</td>' +
                        '<td>' + surName + '</td>' +
                        '<td>' + daNumber + '</td>' +
                        '<td>' + diName + '</td>' +
                        '<td>' + diForm + '</td>' +
                        '<td>' + diSpecifications + '</td>' +
                        '<td>' + diUnit + '</td>' +
                        '<td>' + diCc + '</td>' +
                        '<td>' + mfName + '</td>' +
                        '<td>' + daName + '</td>' +
                        '<td>' + diNewPrice + '</td>' +
                        '<td>' + dqlName + '</td>' +
                        '<td>' + dcName + '</td>' +
                        '<td>' + a + '</td>' +
                        '</tr>'
                    $(".a").append($tr);
                }
            }
        }
    )
}

/*//全选
function selectAll(obj) {
    var checkboxEle = document.getElementsByClassName("selectItem1");
    for (var i = 0; i < checkboxEle.length; i++) {
        checkboxEle[i].checked = obj.checked;
    }
}*/

//获取复选框的值
function show() {
    obj1 = document.getElementsByClassName("selectItem1");
    var sdiI = [];
    for (k in obj1) {
        if (obj1[k].checked)
            sdiI.push(obj1[k].value);
    }
    $.ajax({
        url: '/myspringboot/CommodityController/addSdi',
        type: 'post',
        dataType: 'json',
        traditional: true,
        data: {
            sdiId: sdiI,
        },
        success: function (result) {
            alert(result.msg)
            window.location.href = "../../../../main.html";
        }
    })
}